package com.szh.cloud.common.response;

import lombok.Data;

@Data
public class Result {
    private boolean success;
    private String message;
    private Object data;
    private int code;

    public Result(boolean success, String message, Object data, int code) {
        this.success = success;
        this.message = message;
        this.data = data;
        this.code = code;
    }

    public static Result success(Object data) {
        return new Result(true, "操作成功", data, 200);
    }

    public static Result success(String message) {
        return new Result(true, message, null, 200);
    }

    public static Result error(String message) {
        return new Result(false, message, null, 500);
    }
} 